package snippet;
/*
 * The MIT License (MIT)
 * 
 * Copyright (c) 2013 Jean-Sebastien Lerat (Jean-Sebastien.Lerat@ulb.ac.be)
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

/**
 * 
 * @author Jean-Sebastien Lerat (Jean-Sebastien.Lerat@ulb.ac.be)
 * @version 1.00, 24/06/2013
 */

import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

import be.ac.ulb.mlg.utils.DefaultRenormalizer;
import be.ac.ulb.mlg.utils.Measure;
import be.ac.ulb.mlg.utils.Measurer;
import be.ac.ulb.mlg.utils.measure.Pearson;

public class ShuffleRun{
	private static final int SAMPLES	= 500;
	private static final boolean NATIVE	= true;
	
	static enum Test{
			PERMUTATION_WITH_RENORM(true,true),
			PERMUTATION_WITHOUT_RENORM(false,true),
			NO_PERMUTATION_WITH_RENORM(true,false),
			NO_PERMUTATION_WITHOUT_RENORM(false,false)
		;
		
		public final boolean normalize,shuffle;
		Test(boolean normalize,boolean shuffle){
			this.normalize	= normalize;
			this.shuffle	= shuffle;
		}
	}
	
	public static void main(String[] args) throws InterruptedException{
		final String[] labels = {"M1","M2","m1","m2"};
		final double[][] data = new double[][]{
				//M1(),M2(),m1(),m2()
				{0.03268446,6.568072e-05,0.02631592,0.01096008,0.00813627,0.02570996,0.01618731,0.002727031,0.03267853,0.02692691,0.04529,0.03088026,0.02206529,0.01861699,0.02627881,0.003795875,0.0320486,0.02512688,0.03329974,0.05266444,0.02717231,0.01541313,0.04334366,0.03867224,0.03231052,0.05220945,0.03294532,0.0393892,0.05406731,0.03388469,0.05227772,0.06156594,0.04150836,0.04298644,0.03779089,0.04116477,0.0443815,0.06071542,0.05193825,0.05223214,0.06489568,0.05094911,0.06831038,0.07358444,0.06384715,0.05246419,0.06066253,0.07141474,0.08006485,0.06934251,0.07366661,0.07245658,0.065115,0.07169773,0.07850504,0.06760557,0.07548132,0.08684776,0.07458678,0.09167933,0.07595745,0.08034182,0.1011305,0.08791307,0.07532934,0.07728438,0.09177095,0.1002006,0.07899528,0.07774201,0.08742422,0.09994438,0.0924347,0.07619495,0.08347411,0.1030806,0.08846354,0.1155043,0.09957289,0.09885637,0.09824761,0.09042052,0.09711132,0.1107991,0.09839152,0.1148168,0.09736431,0.1215348,0.1115113,0.1065109,0.1153632,0.1215735,0.1064438,0.1038116,0.1313786,0.09856035,0.1296293,0.1172054,0.1297526,0.1345968,0.1541535,0.1326919,0.1336682,0.1391193,0.129481,0.1273745,0.121656,0.1409418,0.1394694,0.1268561,0.1402748,0.1340413,0.1378911,0.1276254,0.1498114,0.1383793,0.1330334,0.1424743,0.1389848,0.1460974,0.1444506,0.1797052,0.1289692,0.1523662,0.1644994,0.1658612,0.1688617,0.1510979,0.1710971,0.1475106,0.1716748,0.1605633,0.1569227,0.1505115,0.159886,0.160854,0.1649728,0.1686732,0.1506783,0.1654195,0.1526919,0.1693523,0.1717377,0.1687105,0.1733488,0.1550125,0.1791761,0.1855342,0.1682692,0.1890255,0.1824751,0.1899423,0.1830342,0.1810015,0.1794754,0.1852176,0.1778788,0.1835179,0.1869202,0.1772814,0.1923176,0.2065477,0.2164327,0.1812423,0.1934633,0.1715309,0.1951369,0.1993641,0.203297,0.1980089,0.1933363,0.1979492,0.1943925,0.2058103,0.1961737,0.201634,0.2189941,0.2092752,0.2183539,0.2118158,0.1973897,0.1989486,0.2044208,0.2118964,0.2230758,0.2185335,0.2072646,0.2187825,0.2248018,0.2268736,0.2253809,0.2270037,0.2395856,0.2159394,0.2375664,0.23615,0.2500923,0.2362456,0.2331519,0.2520394,0.2315945,0.2431264,0.2318874,0.2359426,0.2348341,0.2482344,0.2251472,0.2347676,0.234269,0.2400959,0.2380745,0.2599675,0.2288212,0.2499059,0.2457196,0.2393804,0.2656593,0.2515301,0.2555515,0.2563822,0.2452639,0.2821235,0.2480428,0.2670295,0.2624909,0.2516992,0.2474638,0.248106,0.2549373,0.2617964,0.2559823,0.2665023,0.2569603,0.2447685,0.2659558,0.2623473,0.264454,0.2772136,0.2727443,0.2578703,0.2793947,0.2604499,0.2664209,0.2834129,0.2746088,0.2820914,0.2716431,0.2981672,0.2955359,0.2757843,0.2886537,0.2940922,0.293207,0.2869013,0.2990763,0.2794308,0.2965187,0.3038894,0.2948052,0.2978058,0.3058343,0.3037972,0.2951464,0.3101367,0.2920412,0.2917354,0.289623,0.294896,0.3124601,0.3102107,0.3065702,0.2996972,0.3181039,0.3214223,0.3180315,0.3186384,0.3156483,0.3140961,0.3115353,0.3095491,0.303884,0.3092092,0.3299035,0.3278534,0.3232545,0.3386747,0.3344093,0.3178773,0.3024714,0.3237006,0.3171383,0.3317448,0.3207623,0.3364227,0.3297153,0.3261687,0.3222165,0.3338415,0.3370556,0.3238557,0.3471108,0.3346479,0.3497828,0.3554332,0.3386121,0.3365866,0.3556539,0.3396794,0.3484491,0.3420472,0.3557046,0.3576535,0.3571161,0.3431094,0.3641383,0.3558208,0.3562087,0.3562831,0.371643,0.336068,0.3583301,0.3516802,0.3669783,0.3701538,0.378259,0.3732536,0.3684617,0.3731419,0.3556012,0.3502066,0.3510535,0.3697397,0.3719702,0.3657911,0.3814249,0.3672502,0.3773172,0.3694755,0.365402,0.3726965,0.3675375,0.3890883,0.3586369,0.3855875,0.4066455,0.3680821,0.3912061,0.3964835,0.3841825,0.377025,0.3833342,0.3804349,0.377715,0.3858789,0.3863994,0.3830739,0.3860052,0.3882416,0.3980733,0.4040709,0.3986751,0.4139529,0.408722,0.4075909,0.392301,0.4091202,0.4059088,0.3864012,0.4054509,0.4081973,0.4120906,0.408021,0.4099265,0.4042013,0.4038554,0.4149769,0.4266119,0.4185244,0.419384,0.4221522,0.4284863,0.4190493,0.4297814,0.4300508,0.4084673,0.4067014,0.4234302,0.4170517,0.4147662,0.4228871,0.4248961,0.4283976,0.4356741,0.4421898,0.4265327,0.4447298,0.4243331,0.4300905,0.4384132,0.4312736,0.4278509,0.4458036,0.4356974,0.4294613,0.4343865,0.4462496,0.4396788,0.4403609,0.4340401,0.4389268,0.4468544,0.4628539,0.4388972,0.4523232,0.4606422,0.4611283,0.4449674,0.4517808,0.4502336,0.4535101,0.4436365,0.4460395,0.4677145,0.464333,0.4566627,0.476353,0.4514324,0.4641809,0.4718309,0.4590926,0.483911,0.4675587,0.4721643,0.4622955,0.4636795,0.4764638,0.4816611,0.4626777,0.4700402,0.4728986,0.4519319,0.4807809,0.4935922,0.4848264,0.4826775,0.4736039,0.4941221,0.4794835,0.4960248,0.4679821,0.4750648,0.4783424,0.4621192,0.4856756,0.4829077,0.4962412,0.4771719,0.5061745,0.4924437,0.484553,0.5095759,0.4908484,0.4969826,0.5043073,0.5026737,0.4806899,0.48907,0.5136208,0.4957678,0.4934475,0.4976077,0.4955923,0.5052179,0.5036159,0.5122087,0.5162259,0.5281556,0.5031265,0.5210915,0.5139493,0.5056713,0.5084097,0.520085,0.5171494,0.5127352,0.5172908,0.5048645,0.5282794,0.5195189,0.5263234,0.5179221,0.5311795,0.5122283,0.519973,0.5348087,0.5396044,0.5445013,0.5452427,0.5310549,0.5232737,0.5360124,0.5516397,0.5412905,0.5429285,0.5298695,0.5259903,0.5488662,0.5400433,0.5260393,0.5321474,0.5391556,0.5468328,0.5315161,0.5287601,0.5338698,0.5700877,0.5450747,0.5548403,0.5327362,0.547967,0.5451809,0.5432027,0.5575751,0.5513289,0.5335067,0.5586749,0.5636402,0.5656817,0.553967,0.5619003,0.5595279,0.5695437,0.5567522,0.5620145,0.5585897,0.5547057,0.5672625,0.5737871,0.5752494,0.5739453,0.585189,0.5664802,0.5709217,0.5593658,0.5678494,0.5731432,0.5586903,0.5776569,0.5875048,0.5666092,0.5807362,0.5750086,0.5747642,0.5812376,0.584528,0.5996402,0.5814412,0.5993759,0.5935934,0.5632773,0.5741688,0.5752187,0.5774476,0.5832064,0.5741543,0.5775877,0.5842588,0.5905704,0.589157,0.5989705,0.586252,0.5809654,0.6060578,0.6059093,0.6107934,0.6100224,0.592227,0.6048852,0.5943907,0.6034412,0.6040042,0.6004227,0.5920869,0.5973601,0.6156631,0.632129,0.6137143,0.6144122,0.5974661,0.5968563,0.6134514,0.6108757,0.6016711,0.5980905,0.6295776,0.6146403,0.6239136,0.6284666,0.6104236,0.6358795,0.6093127,0.6331257,0.6416024,0.6490042,0.637271,0.6252888,0.6459979,0.6439051,0.6252267,0.6182533,0.6202944,0.6298227,0.6248067,0.6307554,0.6167482,0.6288381,0.6398906,0.6518981,0.6574436,0.637502,0.6501125,0.6412313,0.6321169,0.6488655,0.6354287,0.6580127,0.6478831,0.6425665,0.6515208,0.6369556,0.6653344,0.6524213,0.652305,0.65019,0.6505888,0.6665634,0.6597444,0.6694179,0.6616492,0.6433204,0.6536464,0.6759398,0.6525307,0.6587587,0.6764122,0.6605674,0.6536908,0.6868551,0.6650502,0.6784762,0.6688706,0.6692401,0.6845132,0.6733897,0.6668962,0.6753791,0.6682575,0.6656393,0.6599523,0.6661472,0.6747335,0.6690404,0.6657271,0.6811505,0.6956414,0.6702796,0.6839349,0.6995062,0.680654,0.686719,0.6807614,0.6879552,0.6718333,0.7083934,0.6702433,0.6847644,0.7103752,0.696202,0.689364,0.6960262,0.7019494,0.6771532,0.7171734,0.7126099,0.6890671,0.7277164,0.6967348,0.6931608,0.716892,0.7020095,0.7122031,0.7084782,0.696988,0.6999626,0.7350959,0.7143022,0.6965032,0.7268811,0.7117331,0.7132374,0.6950974,0.7233638,0.7187309,0.7153099,0.7251057,0.7116345,0.7381654,0.7161606,0.7053135,0.7147151,0.6978359,0.7065579,0.7124754,0.7267139,0.7288571,0.7213709,0.7553889,0.7269033,0.7319363,0.729222,0.7173284,0.6924424,0.7505817,0.7334102,0.7205566,0.7473936,0.732158,0.7338625,0.7290977,0.7204431,0.7439827,0.7545539,0.7297649,0.7308583,0.7663011,0.7244673,0.7516672,0.7534615,0.7188395,0.7481676,0.7589205,0.7365385,0.745558,0.7535874,0.7416605,0.7513542,0.7651372,0.7518027,0.7371891,0.7531727,0.7487447,0.7376279,0.7421942,0.7555301,0.7875705,0.7594602,0.776077,0.7487372,0.7645325,0.7685532,0.7744476,0.7585367,0.7481146,0.7759213,0.7663284,0.749555,0.7651117,0.7812469,0.7705238,0.7907363,0.7464811,0.7608358,0.775781,0.7930157,0.7660444,0.7964547,0.7722961,0.7886474,0.791534,0.7735743,0.776733,0.7732238,0.7820435,0.8035631,0.7564569,0.7936146,0.7863386,0.7781949,0.7858797,0.7858011,0.8000802,0.7832633,0.8016954,0.7865333,0.7779005,0.8103758,0.8035228,0.8154733,0.7838323,0.8060424,0.7894062,0.8160639,0.783296,0.7785613,0.7948583,0.772256,0.803796,0.8015217,0.7632658,0.8128577,0.8067948,0.8171329,0.7915611,0.8045617,0.7895213,0.7950553,0.8071129,0.8074958,0.8365402,0.8051037,0.8214522,0.7856287,0.8003126,0.8086959,0.8135053,0.8287014,0.8181164,0.8241209,0.8272486,0.8132791,0.8188582,0.8354268,0.8337955,0.8224803,0.8125641,0.8382369,0.8284173,0.824277,0.8420583,0.8155709,0.8138476,0.8294862,0.8434864,0.8278,0.8300856,0.8320127,0.830335,0.8124465,0.8307113,0.836452,0.8370822,0.8424609,0.8400623,0.8571151,0.8353751,0.8427203,0.8277397,0.8211295,0.8443345,0.838958,0.8390198,0.8395776,0.8453858,0.8736301,0.8498519,0.8653121,0.8421783,0.8703184,0.849151,0.8559804,0.8605528,0.8479231,0.8399456,0.8714312,0.8622673,0.8603137,0.8550699,0.8455149,0.8491642,0.847361,0.8406823,0.8529487,0.867423,0.8532224,0.8596508,0.8660297,0.8472313,0.8698852,0.8785909,0.8632388,0.8714449,0.8693596,0.8840256,0.8710393,0.8889971,0.8733976,0.8826904,0.8585856,0.8955401,0.86704,0.8755406,0.8982616,0.8789367,0.8617174,0.8860574,0.9064231,0.8851756,0.919533,0.8710518,0.9008274,0.9096695,0.8856831,0.8933492,0.8634548,0.8711962,0.8875274,0.8813861,0.9123589,0.9072733,0.8852614,0.9051183,0.9027192,0.8917441,0.8826358,0.888862,0.9103361,0.8989372,0.8942006,0.8804015,0.9013941,0.896009,0.9056904,0.8823363,0.919458,0.8968494,0.8991313,0.8977032,0.9178935,0.8986546,0.9217747,0.8918112,0.913165,0.8997764,0.9182543,0.9122166,0.9353534,0.9019699,0.8980752,0.9127211,0.9120449,0.9179733,0.9214199,0.909023,0.9257147,0.8952621,0.9059034,0.8852534,0.9264564,0.923484,0.9405215,0.9027607,0.9324031,0.9099698,0.9522546,0.9364422,0.8909462,0.9115746,0.9049457,0.9378225,0.899722,0.9205885,0.9305342,0.913338,0.9325636,0.955537,0.9317101,0.9577602,0.9427331,0.8965564,0.9292773,0.9394855,0.9285652,0.9608473,0.9480955,0.9323527,0.9376991,0.925581,0.9433232,0.9341556,0.9545474,0.9510182},
				{0.9535204,0.9612116,0.9637433,0.9639976,0.9631381,0.9415551,0.9475046,0.9838225,0.942441,0.9658635,0.9134148,0.9473623,0.9584321,0.935337,0.9647079,0.9726844,0.9325009,0.9698102,0.9481322,0.9314932,0.9452074,0.9776125,0.9285007,0.9427933,0.9354189,0.9267095,0.9591971,0.9358858,0.9120095,0.9559557,0.9241099,0.9277059,0.9373525,0.9410047,0.95379,0.9146387,0.9255075,0.9104507,0.9105701,0.9187743,0.9059596,0.9291092,0.8920798,0.9119082,0.9255058,0.9165809,0.919893,0.8753986,0.9129803,0.9176018,0.8740925,0.8758256,0.9128018,0.8996741,0.8785919,0.9291947,0.8914838,0.8929105,0.8899291,0.8949775,0.8939164,0.8958961,0.8648989,0.8818854,0.9198186,0.9009465,0.8943114,0.8657048,0.9013966,0.9093371,0.8930683,0.8855095,0.8702953,0.9020025,0.8899023,0.8554421,0.895955,0.8532524,0.8866516,0.8726054,0.8714667,0.8906066,0.8528539,0.8371518,0.8800374,0.8432206,0.881251,0.8581874,0.8751362,0.8880049,0.8549597,0.8355398,0.8745869,0.8385743,0.8382935,0.8751118,0.8392553,0.855543,0.8407759,0.85154,0.8443757,0.8458108,0.8536235,0.8440727,0.8505024,0.8647244,0.8451321,0.84134,0.8343024,0.8618845,0.8564782,0.8312764,0.846929,0.8494191,0.830194,0.8370536,0.8445873,0.832942,0.8359578,0.8401673,0.8536709,0.8038215,0.8206517,0.8228183,0.819509,0.7901489,0.8202633,0.8400118,0.7975978,0.8158577,0.8228062,0.8320445,0.7943963,0.8141122,0.8067485,0.8229043,0.8092012,0.8127827,0.8396308,0.8208174,0.8176338,0.8238541,0.8047977,0.8080627,0.795841,0.8100289,0.8134581,0.8067067,0.813303,0.8052946,0.784169,0.7891097,0.7782147,0.7917678,0.7715601,0.7905958,0.7948367,0.7981931,0.7875825,0.7800834,0.7639991,0.7744972,0.7779701,0.7808444,0.7898889,0.784158,0.7676151,0.7696297,0.7445755,0.7907369,0.7682572,0.7870899,0.7871338,0.770404,0.7712403,0.782031,0.7483471,0.7761369,0.7560182,0.7697855,0.7925317,0.7778173,0.7733825,0.7637008,0.7270819,0.7592441,0.7768455,0.7789059,0.7553392,0.7609838,0.7431988,0.7515991,0.7558083,0.7422943,0.7490498,0.7452129,0.7094318,0.7440356,0.7375199,0.7291122,0.7346832,0.7153628,0.7217641,0.7201261,0.7428098,0.7404979,0.73153,0.7260485,0.7546237,0.7298194,0.7304731,0.7354794,0.7426267,0.7337738,0.7187543,0.7284349,0.7193387,0.7123308,0.7251664,0.7030154,0.7036936,0.6999236,0.7154926,0.7060948,0.7144648,0.7234387,0.7179174,0.733409,0.7023321,0.7225959,0.7164392,0.7243042,0.7037428,0.7180314,0.6947393,0.695866,0.7185326,0.6947365,0.7033407,0.7106061,0.6771824,0.7087434,0.6828332,0.687121,0.7140521,0.6989125,0.6932352,0.6718643,0.6849491,0.6969093,0.6845522,0.6750879,0.6761003,0.6909535,0.6995753,0.6780395,0.6717476,0.6888779,0.6809416,0.700447,0.671655,0.6668418,0.6778918,0.6620582,0.6704382,0.6730242,0.6794192,0.684506,0.6564277,0.6606237,0.6679992,0.6662724,0.6586576,0.6600413,0.6433274,0.6427465,0.6693891,0.6610516,0.6374482,0.6602615,0.6606514,0.6552692,0.6557072,0.645326,0.6538972,0.641392,0.6519073,0.6551555,0.6607204,0.6525533,0.6488509,0.6420944,0.6440755,0.6450847,0.6485841,0.627211,0.6366332,0.644606,0.6486377,0.6382743,0.6397665,0.6319823,0.6202172,0.6360396,0.6369916,0.6310447,0.6238978,0.628458,0.6154325,0.6104001,0.6209023,0.6154811,0.6265776,0.6370209,0.6139593,0.6333768,0.6185517,0.6256705,0.6083089,0.6111551,0.6113768,0.6182144,0.6100507,0.5809908,0.5821429,0.599384,0.5926979,0.5939625,0.5938612,0.6046165,0.6111443,0.6016572,0.6079145,0.6006347,0.590418,0.5891768,0.6104592,0.5823149,0.5740662,0.5778563,0.5998539,0.6013133,0.6076538,0.6103078,0.5751154,0.5816262,0.5846461,0.573956,0.5732493,0.5841184,0.5893551,0.5819309,0.5819928,0.585011,0.5859985,0.5861661,0.5747082,0.5688168,0.5884086,0.5716785,0.5627846,0.5769529,0.5756844,0.5803441,0.5693852,0.5601759,0.5702345,0.5638208,0.5651071,0.5455455,0.563349,0.572635,0.5656653,0.5463517,0.5636824,0.5604492,0.5433413,0.5607377,0.5495271,0.5268991,0.5509041,0.5432654,0.5461088,0.5479692,0.5446731,0.5458778,0.5322881,0.5463658,0.5426351,0.5610654,0.5354122,0.5492593,0.5557825,0.523024,0.5410173,0.5483941,0.5409293,0.5398674,0.515687,0.5536798,0.5367889,0.540884,0.5270617,0.5372162,0.5454443,0.5404179,0.5531732,0.5266538,0.5238558,0.515898,0.519718,0.5137155,0.5196916,0.5336641,0.5188629,0.5333387,0.5151903,0.5178395,0.5076436,0.502561,0.5155439,0.5286487,0.502946,0.4879876,0.5135635,0.5037424,0.4911355,0.5099728,0.4930546,0.5094811,0.5128361,0.4947402,0.5044388,0.4975598,0.4920905,0.5097533,0.4983278,0.5024795,0.4894619,0.4992943,0.4912554,0.4845907,0.4805739,0.4950299,0.4733755,0.4890572,0.4884719,0.4887719,0.4715464,0.4698732,0.4908043,0.5048015,0.4634815,0.4711323,0.4848431,0.4803823,0.4636672,0.4762985,0.4926343,0.4704771,0.479141,0.4770425,0.4597257,0.4578185,0.4826456,0.4746431,0.4603475,0.4615118,0.4664948,0.4390407,0.4767337,0.4733609,0.471342,0.4598353,0.4523925,0.4642255,0.4570835,0.4530158,0.4556397,0.4565129,0.4557431,0.44826,0.4454182,0.4612399,0.4298218,0.4510189,0.4501192,0.4479185,0.4328446,0.4562784,0.4300589,0.4457144,0.4447272,0.4380936,0.4488966,0.4280537,0.4263896,0.4348863,0.4415035,0.4387676,0.4266508,0.4220499,0.4216239,0.4338862,0.419493,0.4301077,0.4045528,0.4253834,0.4299306,0.4186793,0.4255887,0.4246859,0.4196863,0.4342709,0.4278032,0.4096053,0.4153855,0.4135452,0.4125827,0.4311289,0.4338241,0.4220142,0.4089528,0.4127555,0.407679,0.404467,0.4055897,0.4088698,0.4140098,0.4257889,0.4135659,0.3956778,0.4170225,0.4126149,0.4073155,0.3978526,0.4103883,0.4112621,0.3995882,0.375402,0.3954812,0.3907378,0.3939239,0.379779,0.3929891,0.391061,0.3942388,0.4068436,0.3680411,0.3908007,0.3890031,0.3850172,0.3980711,0.3804538,0.3846065,0.3829952,0.3963894,0.3746927,0.3886713,0.3861116,0.3892256,0.3900151,0.3793207,0.3635765,0.3806782,0.3673345,0.3612994,0.3639691,0.3785691,0.3837809,0.3769385,0.3714512,0.360465,0.3649417,0.3588161,0.3610384,0.3705517,0.3475997,0.3514134,0.3570944,0.3825569,0.3392003,0.3462227,0.352496,0.3487848,0.350433,0.3632346,0.3464635,0.3545664,0.3546906,0.3506961,0.3545307,0.3588431,0.3477318,0.3411563,0.3391075,0.3377988,0.3442323,0.355641,0.3283489,0.3367977,0.3395398,0.3317351,0.3377665,0.3365253,0.3370317,0.3376113,0.3240561,0.3171322,0.336097,0.335697,0.3350167,0.3338346,0.3348694,0.3413233,0.3310418,0.329058,0.3243041,0.3098943,0.325044,0.3032599,0.326094,0.3123973,0.3208387,0.3213465,0.3167718,0.3297211,0.3029983,0.3217829,0.3117484,0.3123313,0.3062287,0.3212357,0.3138978,0.3064127,0.3031376,0.311288,0.3030009,0.3059692,0.3056234,0.2937792,0.3068363,0.3089133,0.3150793,0.3062599,0.3075836,0.3052946,0.2993637,0.3042059,0.2855123,0.2811398,0.3005768,0.2900248,0.2900553,0.2844192,0.2798784,0.3011499,0.2880746,0.2899842,0.2948571,0.2963588,0.2908764,0.2881219,0.2927191,0.2744562,0.2770859,0.2807687,0.2691217,0.2843289,0.2780243,0.2674886,0.2753945,0.2794713,0.2766671,0.2638135,0.2743323,0.2610375,0.2799885,0.2640644,0.27914,0.2627329,0.2744497,0.255411,0.2767525,0.2602562,0.2619893,0.2572519,0.2607032,0.2648314,0.252956,0.2625969,0.2575628,0.2590109,0.2577427,0.2485813,0.2339619,0.273634,0.2468257,0.2512155,0.2457553,0.2576141,0.2501589,0.2558197,0.2454528,0.2370547,0.2554674,0.2282875,0.2501327,0.2512645,0.2311545,0.2583414,0.2498157,0.2324162,0.2318106,0.2290086,0.2377843,0.2300908,0.2396747,0.2341434,0.2248617,0.2399896,0.2379139,0.2251372,0.2172863,0.2408986,0.2279775,0.2172845,0.2311719,0.2282925,0.2442184,0.2321976,0.2054241,0.2330944,0.2091633,0.2209699,0.2286899,0.2217412,0.2115334,0.2271583,0.2158092,0.2111768,0.21316,0.2063227,0.2058859,0.2269808,0.2236281,0.2177211,0.202988,0.2159497,0.2090434,0.216159,0.2251978,0.2210846,0.1954347,0.1921448,0.2090103,0.2005875,0.1994664,0.2080062,0.2090661,0.1909744,0.1964904,0.2011072,0.2069698,0.1923041,0.1978524,0.1898901,0.1938957,0.1820552,0.184631,0.1896615,0.1807538,0.1986441,0.1721332,0.1913544,0.181495,0.1903215,0.183473,0.1674552,0.1895014,0.1917568,0.1820633,0.1764737,0.169347,0.1971614,0.1603026,0.1619674,0.1613032,0.1674818,0.1723546,0.1645717,0.1748118,0.1787333,0.1802459,0.167895,0.1620375,0.1622745,0.1603556,0.173451,0.1699789,0.1645587,0.1626546,0.1681852,0.1745654,0.1675008,0.1604445,0.1532383,0.1709837,0.1687643,0.164795,0.154555,0.142158,0.1418576,0.1518722,0.1567793,0.1482549,0.1483049,0.1426829,0.1356682,0.1425666,0.133494,0.1542071,0.1571147,0.1504875,0.1528852,0.1395122,0.1347759,0.1363726,0.1385666,0.1490632,0.1260713,0.1265082,0.1226731,0.1364256,0.1319316,0.1242638,0.1179699,0.128983,0.1162981,0.137267,0.1438276,0.1331111,0.1198148,0.1207301,0.1309242,0.1143023,0.1185634,0.1367655,0.1315424,0.1200584,0.1181429,0.1034945,0.1243708,0.1220368,0.1054956,0.1019482,0.1205849,0.1126881,0.1073618,0.1249356,0.1088636,0.1087069,0.1062873,0.1137928,0.1057846,0.09369125,0.1122675,0.09488013,0.1014721,0.1136069,0.1089896,0.1112589,0.114725,0.09526677,0.09361265,0.115265,0.1144575,0.1101511,0.1002874,0.1075596,0.1132504,0.09559145,0.1014852,0.09673484,0.0945017,0.09712626,0.0970414,0.0936246,0.08458339,0.09688868,0.09420052,0.1004926,0.08256423,0.0864429,0.07506447,0.09108276,0.082182,0.1019279,0.07498039,0.09436201,0.08978316,0.06647444,0.07916488,0.07509413,0.0787391,0.06464617,0.09588135,0.06808414,0.0759282,0.07177463,0.0533777,0.0689095,0.06130256,0.06566562,0.08679899,0.06285175,0.05966975,0.05582714,0.04843161,0.06430435,0.05842067,0.06241913,0.05588659,0.06963265,0.06685555,0.05081619,0.05025912,0.05938204,0.04655265,0.05612416,0.05885177,0.05529133,0.06399891,0.03255573,0.06149744,0.04540475,0.05926759,0.04013257,0.04817178,0.05237707,0.05909598,0.05162815,0.06052194,0.03956941,0.04705773,0.05425238,0.05853742,0.03742353,0.043707,0.04901132,0.04375931,0.03946454,0.04250295,0.02816633,0.05336589,0.05444268,0.04031766,0.03403092,0.0216961,0.03389686,0.05350239,0.01796824,0.03482176,0.01987954,0.02158494,0.0319754,0.03109263,0.04257465,0.02902015,0.03506385,0.02612546,0.03235254,0.02926353,0.02369713,0.01219876,0.01074994,0.005099806,0.01817455,0.03494784,0.02878105,0.008278353,0.02053154,0.007486809,0.02093052,0.01711997,0.0004851213,0.01093792,0.01316169,0.0008548562,0.01470912,0.0002469555},
				{0.006014204,0.01250592,0.003024935,0.008119597,0.009405889,0.008971635,0.009792592,0.001926942,0.01953836,0.003293747,0.01540466,0.006310267,0.01103544,0.008400464,0.008635596,0.001743743,0.01640935,0.004662638,0.002974655,0.007557506,0.01257184,0.001339077,0.007055521,0.001840867,0.009691633,0.001541782,0.0005146936,0.01564243,0.01602109,0.006857493,0.008274163,0.003953266,0.009335037,0.001601365,0.00318957,0.01804108,0.008049783,0.01181092,0.02829029,0.002590475,0.02666205,0.003353072,0.03367602,0.00811388,0.005467006,0.01078935,0.0004066699,0.02310385,0.006085431,0.00766782,0.01798628,0.00874101,0.01178776,0.01464717,0.01908442,0.002140014,0.0188614,0.01294167,0.0142249,0.01105028,0.001968926,0.01671886,0.01270016,0.02960302,0.0004606188,0.005570201,0.009600721,0.006515118,0.01279803,0.008188669,0.00129065,0.001929077,0.02901714,0.01353517,0.01027946,0.02735758,0.006844332,0.01750211,0.001713609,0.00985626,0.01103623,0.006283955,0.03198955,0.02019408,0.009201009,0.02605255,0.003252247,0.01426615,0.007824432,0.003802726,0.01489158,0.01888052,0.004142719,0.02862625,0.0009272955,0.006139902,0.009235511,0.01498668,0.002040497,0.004549056,0.0004146501,0.000606907,0.00759642,0.00833966,0.004581562,0.006026927,0.02118582,0.005349404,0.01239858,0.00114411,0.002574809,0.02408327,0.007630563,0.003830646,0.005161878,0.001644888,0.008199272,0.02426607,0.02028735,0.0008344552,0.001657641,0.0002632603,0.02482021,0.01783122,0.005169197,0.02343074,0.008153163,0.007173438,0.01839697,0.004762049,0.00541947,0.004336023,0.01189121,0.01112247,0.01841226,0.00458408,0.00499633,0.003744302,0.001459341,0.01306997,0.008886285,0.006381473,0.00584964,0.004636601,0.005776949,0.01113776,0.005723403,0.002042492,0.01136555,0.005066454,0.007257132,0.007573107,0.007203666,0.02005838,0.009531678,0.02264372,0.002984023,0.01212929,0.01633481,0.02039588,0.03864055,0.00494953,0.002321369,0.004514489,0.003456911,0.03874691,0.02799417,0.02984284,0.041408,0.005092444,0.007165413,0.009910172,0.001605776,0.01255099,0.008019066,0.01236645,0.02263736,0.008225936,0.01576502,0.01324471,0.009075754,0.006534417,0.01525825,0.02319978,0.02213047,0.01672525,0.001763509,0.0004196278,0.008676678,0.001551799,0.0170987,0.008833224,0.0004967616,0.03344224,0.01044296,0.003361323,0.02872522,0.01432066,0.02263484,0.0001831309,0.01068264,0.01978517,0.01804998,0.03201454,0.01037403,0.001052493,0.007993274,0.0170445,0.003771021,0.02768327,0.01646665,0.003475254,0.01825913,0.007000066,0.02237357,0.005265078,0.001659189,0.007294191,0.01897899,0.01403897,0.02028554,0.006446093,0.02170634,0.01116347,0.01348689,0.02129087,0.01243585,0.01460778,0.03233886,0.004306987,0.009375027,0.001694644,0.01851723,0.01409358,0.01847891,0.02983409,0.009770951,0.01635825,0.01152395,0.005909135,0.01340034,0.02073453,0.03812042,0.008597893,0.0111234,0.01752712,0.01315594,0.02922647,0.01458113,0.024264,0.001829738,0.02384182,0.02005488,0.0127825,0.0007323607,0.02958542,0.02844833,0.0009049703,0.01385639,0.000249454,0.001103892,0.02802849,0.01674169,0.02354505,0.01485273,0.006370553,0.006564589,0.01542104,0.01670482,0.01608995,0.01224444,0.02067358,0.004156644,0.004656505,0.02312676,0.01246429,0.006284315,0.01099981,0.03710455,0.02789099,0.02368033,0.03166453,0.01405869,0.01042221,0.01503234,0.01058194,0.004726078,0.01808525,0.01372075,0.01089933,0.03021122,0.001096241,0.02028817,0.01265039,0.007639517,0.02647045,0.02354117,0.003738294,0.007533563,0.02380755,0.008591656,0.02131091,0.02110315,0.001740358,0.01904226,0.01180228,0.006611249,0.01730935,0.03042971,0.02209198,0.01638705,0.0190761,0.007490254,0.01723156,0.0164122,0.002809937,0.01612497,0.01217131,0.01093724,0.02984434,0.009326446,0.00948568,0.02218133,0.02384124,0.02092767,0.01125353,0.02767411,0.004047952,0.02958975,0.01625707,0.03486148,0.02538405,0.01136123,0.02038252,0.0245496,0.02448211,0.003428665,0.01831501,0.03339353,0.02463708,0.01266712,0.00581703,0.01633535,0.00238306,0.0126619,0.01976722,0.01394995,0.01840717,0.02715692,0.03237965,0.02178196,0.01416487,0.020192,0.01857639,0.02208885,0.01605049,0.01130374,0.01823675,0.002669619,0.009326157,0.036323,0.006796518,0.008689085,0.01132021,0.02955176,0.0152289,0.01774029,0.01582796,0.005915894,0.03083244,0.009578228,0.0170877,0.02040356,0.02316792,0.006437995,0.02143617,0.01753151,0.01567116,0.02923414,0.02209599,0.01715967,0.002405788,0.02114981,0.01474701,0.03871084,0.03046651,0.02831394,0.02880507,0.02503263,0.01158467,0.03259032,0.01955893,0.007592294,0.02117441,0.01822518,0.0008994024,0.02113952,0.02731788,0.0154909,0.004830181,0.01312873,0.006188665,0.03269912,0.02883766,0.01459032,0.008230423,0.0007217634,0.01354908,0.02129945,0.02873031,0.02013645,0.01608734,0.01753003,0.009733698,0.001394622,0.000715672,0.03711275,0.01486949,0.03397627,0.02912157,0.03356944,0.02514619,0.0214951,0.0349673,0.02151268,0.01085911,0.04260606,0.009316613,0.01756845,0.02434162,0.001745192,0.02327401,0.01494315,0.01970805,0.02870562,0.01177243,0.00531344,0.02041463,0.009894949,0.009905912,0.02954946,0.0236057,0.02155196,0.008624555,0.02330388,0.02956586,0.00224428,0.0244281,0.02234358,0.04504552,0.0238186,0.001007582,0.04787786,0.02799898,0.031597,0.02014195,0.03077487,0.01212871,0.01069881,0.02133509,0.00382985,0.02710832,0.02186724,0.02827604,0.006711569,0.03250692,0.01741968,0.02281477,0.02891495,0.03524463,0.01085505,0.02328662,0.00920872,0.01269367,0.01662839,0.009979781,0.004497763,0.03335107,0.007738112,0.02891171,0.02048636,0.04079464,0.02467536,0.001101297,0.0449464,0.01627215,0.0237142,0.02187355,0.04183897,0.01454456,0.0390722,0.01940116,0.02727487,0.02850272,0.01573436,0.0149377,0.0170636,0.01524145,0.02118755,0.03465253,0.02259825,0.01516572,0.02642878,1.189108e-05,0.03492584,0.02827843,0.02321763,0.02871496,0.02869522,0.0320824,0.03475215,0.01566914,0.02634211,0.0274076,0.03720745,0.01039707,0.02203663,0.02796123,0.03661653,0.01270604,0.005136264,0.02350632,0.02014146,0.0205309,0.03562716,0.02363743,0.02359523,0.0159319,0.01879939,0.002935491,0.01401116,0.02065213,0.01444528,0.02131167,0.02571713,0.02782348,0.01831095,0.01440276,0.01852926,0.02829182,0.01740801,0.03202813,0.01872298,0.03465614,0.0306611,0.02688099,0.03093898,0.009342433,0.03776948,0.02906475,0.01870044,0.02704866,0.02606108,0.03197625,0.02458211,0.01566358,0.01153236,0.02472592,0.01322362,0.02342776,0.02234051,0.009299404,0.02403132,0.03859809,0.02415441,0.03964088,0.03369388,0.03824039,0.01748817,0.01721621,0.02067366,0.03278336,0.0181718,0.02452728,0.01967719,0.0235955,0.03158784,0.03912149,0.0331874,0.02821431,0.008752696,0.02821706,0.03198924,0.03580409,0.02481862,0.003367122,0.01694149,0.03602872,0.03702925,0.03681573,0.01794665,0.02674765,0.02049105,0.02062512,0.02523584,0.03321522,0.02990447,0.009235147,0.02991962,0.005233049,0.04870016,0.007948448,0.01364103,0.008117092,0.02012647,0.0318504,0.01586839,0.01465206,0.03106218,0.04135426,0.0195839,0.03237436,0.02630529,0.02755701,0.03244448,0.02282961,0.03035401,0.01752255,0.02537922,0.02652854,0.0459936,0.0208123,0.02517725,0.01980184,0.02954303,0.02035657,0.01654611,0.04800765,0.01369811,0.03326228,0.01424026,0.04041066,0.02423233,0.02440089,0.02681755,0.02135445,0.01190909,0.01224394,0.02398836,0.03696941,0.03570829,0.0132609,0.02588909,0.02101867,0.001003418,0.02042645,0.02175026,0.008121935,0.02066218,0.02361302,0.02659056,0.0204847,0.02350781,0.02331062,0.03897515,0.02940826,0.01927822,0.03567644,0.0231354,0.028373,0.01684874,0.02646664,0.02657786,0.01429346,0.01493693,0.03203458,0.03188793,0.01504191,0.03299944,0.02069433,0.02731209,0.01375889,0.01883011,0.009293286,0.04442653,0.03591963,0.00819181,0.01955153,0.0228857,0.02281703,0.03152309,0.03176957,0.02574712,0.007387617,0.03770318,0.009157376,0.02967556,0.03651798,0.005139354,0.02695522,0.0156288,0.007669783,0.03861096,0.03077868,0.01448921,0.0177584,0.02178808,0.02153778,0.02233712,0.03188778,0.03416001,0.02278348,0.006954478,0.03775506,0.0178225,0.02809237,0.02289376,0.01544034,0.03930033,0.04024883,0.02970788,0.02591353,0.04009107,0.03835415,0.026945,0.02258495,0.01239375,0.03093206,0.02723475,0.02964152,0.0230097,0.03995151,0.01797248,0.04741051,0.0241464,0.0168713,0.03635543,0.01923758,0.02784755,0.02955168,0.02111278,0.03166182,0.01656318,0.04636546,0.000117867,0.02415756,0.01979115,0.02179823,0.03751176,0.03487624,0.02469558,0.03991018,0.03335282,0.03507291,0.02490785,0.01912952,0.009201484,0.02741089,0.03184385,0.0349134,0.03245293,0.0250433,0.02414405,0.02820786,0.01825088,0.02467451,0.01249685,0.02795754,0.02657603,0.01630321,0.02339813,0.02437539,0.01960829,0.00750789,0.01765202,0.04986129,0.03420182,0.02265614,0.03343187,0.01784844,0.04609564,0.03916034,0.02413678,0.03349976,0.02408022,0.02173495,0.0267955,0.01875545,0.02984823,0.01964744,0.02176954,0.04462011,0.02160349,0.02325951,0.03763298,0.0406407,0.03077299,0.04386059,0.02802252,0.03175167,0.02818973,0.02928994,0.01538263,0.03128252,0.03325427,0.02539874,0.02211354,0.02199841,0.0308836,0.02284573,0.03218213,0.01780284,0.03799487,0.03682321,0.02392917,0.04791091,0.04096762,0.02094613,0.0401966,0.02177483,0.03232501,0.03884944,0.04768137,0.02939542,0.03089997,0.03091033,0.01525724,0.03875159,0.01110552,0.04016165,0.03691387,0.0538215,0.03691148,0.03996428,0.01631793,0.02918991,0.0247144,0.02656221,0.02126295,0.02756208,0.05003056,0.03336451,0.02949695,0.02250496,0.04108793,0.02672889,0.04313271,0.0309213,0.03577495,0.02997088,0.0320373,0.02813768,0.02459401,0.030778,0.02935012,0.03861965,0.03732119,0.02989803,0.01692186,0.02151425,0.02447571,0.04397624,0.03423632,0.01992874,0.04130029,0.03042892,0.03173239,0.03695969,0.03895395,0.02718822,0.02822768,0.0374756,0.03162218,0.01219808,0.03654755,0.02734891,0.0367529,0.03232107,0.03711184,0.02216876,0.03018966,0.028244,0.03982776,0.008565961,0.03107315,0.01408133,0.02366033,0.03676312,0.02968727,0.0334943,0.03394537,0.03597956,0.02702921,0.03464616,0.03061411,0.03129169,0.04943362,0.02236887,0.0301119,0.03479456,0.0228724,0.02852838,0.02645127,0.04002025,0.02731242,0.02806843,0.03135781,0.03392696,0.02823544,0.03709265,0.02875908,0.02858721,0.03675049,0.02758941,0.02938864,0.02768515,0.01708904,0.008565969,0.03302971,0.02407893,0.03581781,0.03267894,0.03735095,0.0467755,0.03957977,0.04177451,0.04005697,0.02435789,0.0387847,0.037429,0.031135,0.03155564,0.03466624,0.03281948,0.04064241,0.02974951,0.02271464,0.03519478,0.05399366,0.02206307,0.02971631,0.03188539,0.03135984,0.02856692,0.02277646,0.04325479,0.04070553,0.02055035,0.03438874,0.02391747,0.03024656,0.02694126,0.02422216,0.02986942,0.03028966,0.0005707325,0.0330214,0.04825735,0.02379307,0.02595858,0.02682833,0.03048639,0.04491145,0.0342885,0.04018174,0.03040395,0.05140659,0.02432221,0.04262343,0.02270099,0.03921016,0.0465711,0.04145754,0.01646293,0.03452521,0.05250258,0.04165171,0.03703557,0.03022048,0.04603397,0.03249191,0.03461357,0.04112102,0.04353931,0.02772182,0.04550763,0.03185866,0.02267811,0.03444451,0.04141612,0.04215502,0.03980723,0.0289859,0.02761191,0.04416705,0.02988876,0.04493399,0.02530132,0.0571055,0.02786131,0.04286654},
				{0.007780923,0.02621679,0.006915801,0.01692276,0.01931969,0.02376327,0.02651548,0.01152352,0.005342142,0.003915851,0.02589051,0.01544716,0.008467149,0.03764556,0.000377653,0.02177597,0.01904118,0.0004003137,0.0155934,0.008284827,0.01504844,0.00563525,0.02110013,0.01669355,0.02257898,0.01953923,0.007342934,0.009082557,0.0179021,0.003302075,0.0153382,0.006774902,0.01180408,0.01440755,0.005229559,0.0261554,0.02206118,0.01702294,0.009201394,0.02640307,0.002482658,0.01658864,0.005933825,0.006393486,0.005180019,0.02016559,0.01903777,0.03008283,0.0008693791,0.005387833,0.03425455,0.04297682,0.01029544,0.01398097,0.02381869,0.001059737,0.01417345,0.007300068,0.0212592,0.002292875,0.02815724,0.007043178,0.02127042,0.0005985262,0.004391475,0.01619891,0.00431695,0.02757958,0.006810099,0.004732203,0.01821686,0.01261706,0.008252883,0.008267366,0.01634418,0.0141197,0.008737139,0.01374127,0.0120619,0.01868198,0.0192495,0.01268895,0.01804519,0.03185506,0.01237008,0.01591,0.01813246,0.00601163,0.005528065,0.001681401,0.01478551,0.02400624,0.01482656,0.0289879,0.0294006,0.02018792,0.02187985,0.01226496,0.02743102,0.009314103,0.001056175,0.02089031,0.005111799,0.008468397,0.01543504,0.001874177,0.01202605,0.01236882,0.01382969,0.01011525,0.0006721537,0.01059899,0.007549288,0.01912486,0.01483266,0.0229222,0.01418004,0.0003176454,0.004770043,0.0129009,0.0002208465,0.01621008,0.02555889,0.00698424,0.0108224,0.02055916,0.002721874,0.001716866,0.01290817,0.03186966,9.952966e-05,0.003056151,0.03678977,0.02425379,0.01495327,0.01165756,0.0208297,0.01479977,0.008231552,0.0006931961,0.02078801,0.0004121838,0.01761498,0.01859019,0.02503324,0.02382079,0.001642358,0.005716699,0.007062249,0.0006134585,0.02609882,0.01337484,0.03154745,0.007172296,0.03943274,0.00154279,0.02430051,0.006159633,0.009162522,0.02223933,0.00504271,0.01400549,0.00327584,0.03339885,0.01319087,0.005564175,0.009253805,0.001163348,0.0107195,0.006161694,0.03124109,0.00505078,0.01686785,0.01123469,0.02456691,0.003968573,0.01002147,0.006361962,0.009862871,0.005153999,0.001002834,0.01669964,0.006938424,0.001202946,0.02771176,0.005497173,0.01412642,0.001891947,0.01118237,0.01059082,0.01432167,0.01256396,0.004109384,0.008324067,0.002940864,0.01527572,0.01175072,0.005398169,0.006693419,0.0186653,0.02303969,0.02172568,0.02829849,0.01191675,0.01198205,0.01021522,0.03532947,0.02213933,0.007336294,0.002401453,0.01498579,0.001077817,0.010293,0.009320282,0.01315249,0.02691962,0.01334281,0.02884493,0.000303049,0.02656339,0.03075699,0.01150677,0.01475832,0.01571217,0.009557399,0.00357119,0.02218302,0.003877192,0.01039174,0.01130066,0.0182035,0.007498881,0.02077968,0.02310651,0.02082603,0.01195258,0.007242387,0.01169168,0.01239104,0.02561446,0.03002264,0.01007221,0.01262546,0.02086825,0.0002157168,0.001469005,0.0219657,0.0007420236,0.004933932,0.003042375,0.02496431,0.006978144,0.01063781,0.009362727,0.0006161119,0.01294424,0.003285408,0.006327771,0.01039672,0.001497759,0.02140682,0.001332527,0.01022007,0.004260051,0.02266792,0.02886982,0.02439325,0.005177003,0.01440739,0.01307568,0.0131862,0.01335685,0.0190818,0.01387988,0.01551426,0.02615086,0.008678266,0.01385245,0.01391192,0.002298467,0.01178433,0.003857044,0.0003305873,0.01639836,0.007815906,0.009351365,0.008957325,0.008881903,0.02308746,0.01284682,0.003799574,0.02506448,0.01487409,0.005842253,0.01406109,0.02014986,0.01760917,0.01781419,0.006773218,0.01406246,0.004531048,0.01205881,0.00889685,0.006786811,0.005353981,0.02056637,0.01383704,0.0145532,0.005688717,0.0254607,0.007006077,0.007789345,0.008815999,0.002638117,0.005490207,0.007992398,0.009114604,0.00587514,0.009110895,0.02293257,0.02096671,0.02061968,0.0007895849,0.0250142,0.01867043,0.01610883,0.01116627,0.0288476,0.02094779,0.02891981,0.002940657,0.003219065,0.008754018,0.01319166,0.003607575,0.01909084,0.008794997,0.0298946,0.02713827,0.02481005,0.01994144,0.003781368,0.01737398,0.0017217,0.005577221,0.03052442,0.01019783,0.0111533,0.01541129,0.006476889,0.00552876,0.02346929,0.02010022,0.01053379,0.005513181,0.0147095,0.02798291,0.02470482,0.01084851,0.01492445,0.002217364,0.002297698,0.006904486,0.0007448017,0.008762002,0.01547503,0.006116465,0.03395003,0.02352607,0.01542473,0.01498221,0.002256265,0.004004624,0.02627908,0.0260242,0.003137766,0.0125152,0.005066729,0.001854788,0.02885273,0.003449931,0.03527955,0.002959985,0.00723302,0.008148792,0.01695432,0.01596779,0.007777524,0.01756612,0.00446285,0.007101358,0.002784115,0.0009511713,0.01361176,0.01422487,0.005976759,0.01359805,0.002724214,0.03040885,0.01021641,0.02223148,0.007123665,0.004541702,0.004484766,0.005578899,0.00510203,0.006426233,0.01943616,0.02080468,0.01644481,0.0132912,0.007343189,0.02388116,0.004278944,0.01910029,0.004817335,0.002729574,0.01551017,0.008146572,0.01480732,0.007250166,0.0001656045,0.007844382,0.01271203,0.008261028,0.009045431,0.01482606,0.01652963,0.01754603,0.007084626,0.00150771,0.01442702,0.00845379,0.02043667,0.01552439,0.00201052,0.01469763,0.01442812,0.03060304,0.01790121,0.02726322,0.01102273,0.004281925,0.01151911,0.02064312,0.007773034,0.01516176,0.007316484,0.01008527,0.01709918,0.01031225,0.01584861,0.02652141,0.01519312,0.0006521811,0.003234496,0.02838607,0.005398265,0.004223197,0.02363482,0.007453289,0.005000717,0.02142447,0.009598072,0.007969056,0.01216002,0.03316281,0.002052584,0.008822445,0.03226718,0.01480357,0.007760182,0.01423137,0.02385514,0.01877044,0.009568826,0.01026314,0.0105066,0.01553066,0.0006261513,0.01809922,0.002535687,0.009821519,0.02050943,0.01249661,0.01541811,0.02130212,0.001928565,0.005797593,0.002853612,0.01294687,0.003704902,0.01576971,0.01343069,0.0005603418,0.01740417,0.01204557,0.004629575,0.006254085,0.003306235,0.01473848,0.01114468,0.01065687,0.0231734,0.0157116,0.01562358,0.02336338,0.005858333,0.01533485,0.01709089,0.0005035551,0.01281217,0.02245554,0.009561371,0.001119503,0.009909934,0.01750314,0.003653278,0.01806458,0.008197984,0.0158587,0.01127687,0.01333064,0.01538465,0.02318709,0.01322072,0.007174813,0.009516597,0.01322381,0.009375293,0.01289503,0.01412632,0.01178006,0.004058871,0.008377609,0.01961826,0.004038244,0.0005480636,0.006633172,0.02236087,0.001921757,0.01075393,0.01643142,0.02619906,0.008500444,0.008914764,0.01613198,0.006157148,0.006684657,0.01352535,0.01156024,0.01292553,0.001103578,0.006332326,0.006283372,0.001701014,0.01063705,0.001205418,0.004511677,0.02718344,0.01426506,0.02546684,0.01920038,0.01461899,0.02101317,0.01543687,0.02074788,0.007220111,0.01478569,3.236844e-05,0.01613579,0.01480002,0.0153054,0.004621693,0.01071334,0.005343728,0.005633457,0.008393542,0.02100849,0.01125013,0.004686245,0.0321599,0.02970111,0.01433982,0.01073346,0.01407087,0.006109569,0.003095571,0.01093834,0.01163739,0.01790582,0.007845939,0.01899466,0.0335526,0.004030292,0.01303701,0.00838306,0.01806595,0.00401578,0.03053858,0.005189406,0.01938607,0.01302147,0.005112256,0.006077314,0.005829009,0.0005224708,0.01738674,0.02657892,0.004295422,0.02442468,0.00278623,0.01505341,0.006818215,0.009483957,0.01729049,0.0006974366,0.006275295,0.007282851,0.01092553,0.0006340848,0.0118624,0.03030857,0.010494,0.0136818,0.00485893,0.005849674,0.006427558,0.01299817,0.01803373,0.008094094,0.0009393667,0.0022269,0.01151139,0.01618097,0.008944577,0.01705848,0.01533726,0.008393254,0.01408677,0.01686612,0.003963034,0.01266691,0.005143341,0.01632442,0.01142256,0.01926435,0.005659218,0.01008171,0.0123985,0.023399,0.009698415,0.001954242,0.01324442,0.009709364,0.01533422,0.01131438,0.01060969,0.02692818,0.01062267,0.01205899,0.01361654,0.01957311,0.01183692,0.01496552,0.02059992,0.003408439,0.01633018,0.002017639,0.01456235,0.02443793,0.02289137,0.02986532,0.005646214,0.02151667,0.004983661,0.02039551,0.004257967,0.02368594,0.002016747,0.003794671,0.0166276,0.001668556,0.003249996,0.01297356,0.001136893,0.01633772,0.00961801,0.01313726,0.01807929,0.009571231,0.02628923,0.005390099,0.01151603,0.00183356,0.03397756,0.008074734,0.004755431,0.0147143,0.009119514,0.01312853,0.003693781,0.01849487,0.001482262,0.02001714,0.004805786,0.01065327,0.01826636,0.004121613,0.01388156,0.01411485,0.01771287,0.01501727,0.00312138,0.0151893,0.01825986,0.002126519,0.002489963,0.006685546,0.01627478,0.01967233,0.02969214,0.00630861,0.001892997,0.01439837,0.007757559,0.01420202,0.01572797,0.0147623,0.005786826,0.00270693,0.00836023,0.0205776,0.01361291,0.0126111,0.02268529,0.006800439,0.01320692,0.01649041,0.001147008,0.005207075,0.01039131,0.01476645,0.005453769,0.006450829,0.005888101,0.007940253,0.01779846,0.0150174,0.002870456,0.002643457,0.01213099,0.01257721,0.02082727,0.002033802,0.006855037,0.01083862,0.02383888,0.0008852745,0.006077492,0.01117984,0.02059743,0.03116989,0.00960101,0.02371552,0.002731295,0.0107964,0.002201309,0.01398914,0.006784249,0.01776178,0.01925007,0.001438085,0.001351388,0.01852097,0.0003153186,0.01058695,0.009124188,0.01116265,0.01727683,0.00974064,9.279198e-05,0.01987935,0.003830439,0.008748733,0.005442129,0.02092102,0.01664131,0.01861602,0.0100927,0.007158409,0.01263496,0.004188727,0.0019383,0.02095019,0.002187946,0.01208914,0.002172644,0.01183316,0.001133001,0.013853,0.003478696,0.01052393,0.01005012,0.01371171,0.01938851,0.001998079,0.006548445,0.02777337,0.0005724028,0.00632521,0.001859688,0.01889991,0.01417067,0.02279937,0.0257795,0.02932498,0.01106974,0.01668617,0.01216802,0.008139943,0.00634271,0.005661297,0.0008522909,0.01729155,0.002596576,0.02239329,0.01294433,0.01292179,0.01009559,0.005039922,0.004700521,0.01403442,0.01858915,0.01441634,0.01077041,0.01048009,0.01581867,0.005868706,0.01719115,0.01028748,0.009265063,0.01210482,0.02069194,0.009640035,0.0150654,0.0137804,0.02088994,0.02082443,0.02197534,0.02029919,0.01006835,0.001330653,0.0009193114,0.01782896,0.02490264,0.01994299,0.02922271,0.009349775,0.008918165,0.02388887,0.01423992,0.01670479,0.0003789936,0.007816019,0.01364779,0.008801307,0.00248037,0.01226504,0.008243939,0.0002679458,0.01257405,0.005501667,0.02473606,0.01304691,0.01033993,0.006812244,0.007570897,0.02086107,0.01158516,0.0121219,0.01548028,0.00406263,0.01539657,0.01523342,0.005552344,0.006293669,0.01412131,0.006713829,0.005077954,0.01148214,0.001619378,0.0069589,0.00249758,0.008626038,0.007451172,0.003769758,0.005559499,0.001244075,0.001505301,0.005917112,0.006676797,0.005147892,0.0355991,0.005814866,0.001245581,0.001854064,0.003816896,0.01999026,0.003319077,0.001135024,0.01272846,0.007997303,0.0241041,0.002425025,0.007846321,0.01888721,0.007456037,0.005510416,0.01300524,0.005326049,0.003305993,0.01770308,0.01491205,0.003640028,0.00909816,0.02808899,0.0112226,0.01905214,0.02041863,0.01542288,0.007132872,0.02230492,0.01941934,0.0188767,0.01220916,0.002323692,0.0214236,0.01878493,0.001930775,0.01884625,0.008265548,0.01547952,0.01230686,0.01043603,0.009823452,0.006471285,0.01624392,0.01977882,0.01298517,0.01143906,0.008629137,0.003562645,0.01183051,0.0111903,0.009250003,0.0230223,0.01519047,0.01219651,0.002880678,0.004526788,0.003057594,0.01375091,0.01140295,0.007447614,0.02457586,0.01568103,0.01544406,0.002936838,0.01918019,0.02079409,0.002499682,0.01627748,0.0001999283,0.004542399,0.01203231,0.005281292,0.01641419,0.03405122,0.0005255038,0.0100811,0.01109601,0.002679978,0.003362075,0.006360271,0.03192699,0.01854707,0.0182138,0.00788408,0.002882145,0.005868299}
			};
		
		//System.out.println("library loaded: "+Measurer.hasNativeSupport());
		//System.out.println("DATA");
		//println(data);
		
		DefaultRenormalizer renorm = new DefaultRenormalizer();
		
		Measurer measurer = new Measurer(NATIVE,0,renorm);//There are not missing values thus it's better to ignore them
		measurer.setNumberOfThreads(1);//I prefer you use only 1 thread (for now) to localize error
		measurer.setHandelingMissingValues(false);
		measurer.setMaximumMissingValues(0);
		
		System.out.println(SAMPLES+" samples");
		final Measure pearson = new Pearson();
		
		for(boolean usingNative:new boolean[]{false,true}){
			measurer.useNative(usingNative);
			System.out.println("NATIVE: "+usingNative);
			for(Test mode:new Test[]{Test.PERMUTATION_WITH_RENORM}){//Test.values()){
				if(mode.normalize){
					measurer.setRenormalizer(renorm);
					renorm.resetNormalizer();
				}else{
					measurer.setRenormalizer(renorm);
					for(int column=0;column<data[0].length;column++)
						renorm.setNormalizer(column, 1.0);
				}
				renorm.usePairShuffle(mode.shuffle);
				
				System.out.println(mode.toString());
				
				Map<Measure,double[][]> sum		= new HashMap<Measure,double[][]>();
				Map<Measure,double[][]> sum2		= new HashMap<Measure,double[][]>();
				
				for(int run=0;run<SAMPLES;run++){
				
					Map<Measure,double[][]> res = measurer.measure(
													copy(data),
													new Measure[]{pearson},
													null
					);
					
					for(Measure measure:res.keySet()){
						final double[][] current = res.get(measure);
						if(! sum.containsKey(measure)){
							sum.put(measure, empty(current));
							sum2.put(measure, empty(current));
						}
						final double[][] ref = sum.get(measure);
						final double[][] ref2 = sum2.get(measure);
						for(int i=0;i<current.length;i++)
							for(int j=0;j<current[i].length;j++){
								ref[i][j]	+= current[i][j];
								ref2[i][j]	+= current[i][j]*current[i][j];
							}
					}
				}
				
				for(Measure measure:sum.keySet()){
					final double[][] ref = sum.get(measure);
					final double[][] ref2 = sum2.get(measure);
					for(int i=0;i<ref.length;i++)
						for(int j=0;j<ref[i].length;j++){
							ref2[i][j] = Math.sqrt(ref2[i][j] -ref2[i][j]*ref2[i][j]);
							ref[i][j]	/= SAMPLES;
							ref2[i][j]	/= SAMPLES;
						}
				}
				
				Set<Measure> measures = new TreeSet<Measure>(new Comparator<Measure>() {
					@Override
					public int compare(Measure a, Measure b) {
						return a.getClass().getSimpleName().compareTo(b.getClass().getSimpleName());
					}
				});
				measures.addAll(sum.keySet());
				
				//print Mean
				//System.out.println("Mean");
				for(Measure measure:measures){
					double[][] result = sum.get(measure);
					//System.out.println(measure.getClass().getSimpleName());
					println(result,labels);
				}
				/*
				//print SD
				System.out.println("SD");
				for(Measure measure:measures){
					double[][] result = sum2.get(measure);
					//System.out.println(measure.getClass().getSimpleName());
					println(result,labels);
				}
				*/
			}
		}
	}
	private static double[][] copy(double[][] data) {
		final double[][] res = new double[data.length][];
		for(int i=0;i<data.length;i++)
			res[i]=java.util.Arrays.copyOf(data[i],data[i].length);
		return res;
	}
	private static double[][] empty(double[][] current) {
		final double[][] empty = new double[current.length][];
		for(int i=0;i<empty.length;i++)
			empty[i] = new double[current[i].length];//java auto fill with 0
		return empty;
	}
	public static void println(double[][] data) {
		println(null,data, null);
	}
	public static void println(String sep,double[][] data) {
		println(sep,data,null);
	}
	public static void println(double[][] data,String[] label) {
		println(null,data,label);
	}
	public static void println(String sep,double[][] data,String[] label) {
		if(data == null){
			System.out.println("NULL");
			return;
		}
		if(label != null){
			data	= expand(data);
			System.out.print("\t");
			for(int j=0;j<label.length;j++)
				System.out.print("\t"+label[j]);
			System.out.println();
		}
		for(int i=0;i<data.length;i++){
			if(label != null) System.out.print(label[i]+"\t");
			if(sep == null)
				for(int j=0;j<data[i].length;j++)
					System.out.printf((j>0 && data[i][j]<0?"  ":"   ") +format(data[i][j]));
			else
				for(int j=0;j<data[i].length;j++)
					System.out.printf((j>0 ?sep:"")+format(data[i][j]));
			System.out.println();
		}
		
	}
	
	private static double[][] expand(double[][] data) {
		final int SIZE = data.length+1;
		final double[][] copy = new double[SIZE][SIZE];
		for(int i=0;i<SIZE;i++){
			copy[i] = new double[SIZE];
			Arrays.fill(copy[i],Double.NaN);
			if(i < data.length){
				System.arraycopy(data[i], 0, copy[i], SIZE-data[i].length,data[i].length);
			}
		}
		return copy;
	}
	private static String format(double d) {
		if(Double.isNaN(d))return d+"   ";
		return (((int)(d*100))/100.0)+(Math.signum(d)>0?"  ":"  ");
	}
} 
